<!--编辑咨询-->
<template>
    <div>
        <el-row>
            <el-col :span="18">
                <el-form :inline="true" :model="formC" class="demo-form-inline">
                    <!--资质类别-->
                    <el-form-item label="资质类别">
                        <el-select v-model="formC.consult_zizhi_type" placeholder="资质类别" size="">
                            <el-option :label="item.name" :value="item.id" v-for="item in LBMessage"></el-option>
                        </el-select>
                    </el-form-item>
                    <!--资质颁发单位-->
                    <el-form-item label="资质颁发单位">
                        <el-select v-model="formC.consult_zizhi_award_unit">
                            <el-option :label="item.name" :value="item.id" v-for="item in BFMessage"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <!--资质等级-->
                <el-form :inline="true" :model="formC" class="demo-form-inline">
                    <el-form-item label="资质等级">
                        <el-select v-model="formC.consult_zizhi_level">
                            <el-option :label="item.name" :value="item.id" v-for="item in DJMessage"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <!--收费标准-->
                <el-form :inline="true" :model="formC" class="demo-form-inline">
                    <el-form-item label="收费标准">
                        <el-input v-model="formC.consult_charge_standard" placeholder="收费标准"></el-input>
                    </el-form-item>
                    <!--专业领域-->
                    <el-form-item label="专业领域">
                        <el-input v-model="formC.consult_major_field" placeholder="专业领域"></el-input>
                    </el-form-item>
                </el-form>
                <!--添加关键人物-->
                <h3>关键人物</h3>
                <el-form :inline="true" :model="formC" class="demo-form-inline" v-for="(item,index) in keyManmessage" style="padding-left: 80px">
                    <el-form-item >
                        <el-select v-model="entrepot[index].name" placeholder="请选择">
                            <el-option
                                    v-for="data in item.man"
                                    :label="data.label"
                                    :value="data.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="职务">
                        <el-select v-model="entrepot[index].status" placeholder="请选择">
                            <el-option
                                    v-for="data in item.man"
                                    :key="data.value"
                                    :label="data.label"
                                    :value="data.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-button type="text" @click="delMan(index)">移除</el-button>
                </el-form>
                <el-button type="info" @click="addMan" style="margin-left: 80px">添加人物</el-button>
            </el-col>
            <el-col :span="1">
                <hr style="height:200px;width: 1px">
            </el-col>
            <el-col :span="5"><div >
                <h2>评价星级</h2>
                <el-form :inline="true" :model="formC" class="demo-form-inline">
                    <el-form-item>
                        <el-select v-model="formC.consult_evaluate_star" placeholder="评价星级">
                            <el-option label="一星" value="1"></el-option>
                            <el-option label="二星" value="2"></el-option>
                            <el-option label="三星" value="3"></el-option>
                            <el-option label="四星" value="4"></el-option>
                            <el-option label="五星" value="5"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
            </div></el-col>
        </el-row>
        <div style="width:100px;margin-left:80%">
            <el-button type="warning" @click="sendFormD">保存能力</el-button>
        </div>
    </div>
</template>
<script>
    import Bus from '@/config/bus.js'
    import _http from '@/components/common/http.vue'
    import _param from '@/components/common/param.vue'
    export default {
        data() {
            return {
                apiPort:{
//                    资质类别列表
                    aptitudeList:'MyProject/diction/getEnterpriseType',
//                    资质颁发单位列表
                    aptitudeawardList:'MyProject/diction/getEnterpriseType',
//                    资质等级列表
                    aptitudelevelList:'MyProject/diction/getEnterpriseType',
                },
                form:{
//                    资质类别列表
                    aptitudeList:'',
                    aptitudeId:'',
//                    资质颁发单位列表
                    aptitudeawardList:'',
                    aptitudeawardId:'',
//                    资质等级列表
                    aptitudelevelList:'',
                    aptitudelevelId:'',
                    star:''
                },
                formC:{
                    consult_zizhi_type:'',
                    consult_zizhi_level:'',
                    consult_zizhi_award_unit:'',
                    consult_charge_standard:'',
                    consult_major_field:'',
                    consult_evaluate_star:'',
                },
                //                关键人物信息存储
                entrepot:[{name:'',status:''}],
                keyManmessage:[{
                    man:[
                        {
                            value: '选项4',
                            label: '人物一'
                        }, {
                            value: '选项5',
                            label: '北京烤鸭'
                        }
                    ],
                    duty:[
                        {
                            value: '选项4',
                            label: '人物二'
                        },
                        {
                            value: '选项5',
                            label: '人物三'
                        }
                    ]}
                ],
                information:{
                    classes:'综合',
                    issued:'住建部',
                    grade:'甲级',
                    charge:'100000元每案',
                    professField:'土地规划，环保设计',
                    keyMan1:'俞兆洪-总裁/CEO-18058715658',
                    keyMan2:'吴高翔-销售-18058715658'
                },
                LBMessage:'',
                BFMessage:'',
                DJMessage:''
            }
        },
        mounted(){
            this.getDicdata()
        },
        methods:{
            //            传递参数的方法
            sendFormD(){
                var that = this
                setTimeout(function(){
                    Bus.$emit("submitFormC",that.formC)
                    that.$message({
                        message: '保存成功',
                        type: 'success'
                    });
                },200)
            },
            getDicdata(){
                var that = this
                //      资质类别
                var paramCom={code:"zx_zzlb"}
                var paramsCom = that.querystring.stringify(paramCom)
                _http.axiosRequest(that,that.apiPort.aptitudeList,paramsCom,(res)=>{
                    that.LBMessage=res.data.data
            })
                //资质颁发单位
                var paramSh={code:"zx_zzbfdw"}
                var paramsSh = that.querystring.stringify(paramSh)
                _http.axiosRequest(that,that.apiPort.aptitudeawardList,paramsSh,(res)=>{
                    that.BFMessage=res.data.data
            })
                //资质等级
                var paramSh={code:"zx_zzdj"}
                var paramsSh = that.querystring.stringify(paramSh)
                _http.axiosRequest(that,that.apiPort.aptitudelevelList,paramsSh,(res)=>{
                    that.DJMessage=res.data.data
            })
            },
            addMan(){
                this.entrepot.push(
                        {name:'',status:''}
                )
                this.keyManmessage.push(
                        {
                            man:[
                                {
                                    value: '选项4',
                                    label: '人物一'
                                }, {
                                    value: '选项5',
                                    label: '人物二'
                                }
                            ],
                            duty:[
                                {
                                    value: '选项4',
                                    label: '经理'
                                },
                                {
                                    value: '选项5',
                                    label: 'CEO'
                                }
                            ]}
                )
            },
            delMan(index){
                this.entrepot.splice(index,1)
                this.keyManmessage.splice(index,1)
            },
            openDialog(dialog){
                this.dialog[dialog].open = true
            }
        }
    }
</script>